﻿using System;
using System.Data;

namespace gms.data {
	public class Player_Campaign {
#region Properties
		public int player_id { get; set; }
		public int campaign_id { get; set; }
		public string gm_notes { get; set; }
		public int campaign_acl { get; set; }
#endregion
#region Constructors

#endregion
#region Additional Loads

#endregion
#region CRUD

#endregion
#region Utilities
		private void fill(DataSet values) {
			if (!Database.dataset_is_empty(values)) {
				for (int i = 0; i < values.Tables[0].Columns.Count; i++) {
					switch (values.Tables[0].Columns[i].ColumnName) {
						case "player_id": player_id = (int)values.Tables[0].Rows[0]["player_id"]; break;
						case "campaign_id": campaign_id = (int)values.Tables[0].Rows[0]["campaign_id"]; break;
						case "gm_notes": gm_notes = (values.Tables[0].Rows[0]["gm_notes"] != DBNull.Value) ? (string)values.Tables[0].Rows[0]["gm_notes"] : null; break;
						case "campaign_acl": campaign_acl = (int)values.Tables[0].Rows[0]["campaign_acl"]; break;
					}
				}
			}
		}
#endregion
	}
}